package com.mxf.code.service;

import com.mxf.code.dao.UserDao;
import com.mxf.code.entity.User;
import com.mxf.code.iaop.log.OperationLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author : [mxf]
 * @version : [v1.0]
 * @className : UserServiceImpl
 * @description : [描述说明该类的功能]
 * @createTime : [2022/9/10 10:33]
 * @updateUser : [mxf]
 * @updateTime : [2022/9/10 10:33]
 * @updateRemark : [描述说明本次修改内容]
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return userDao.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(User record) {
        return userDao.insert(record);
    }

    @Override
    public int insertSelective(User record) {
        return userDao.insertSelective(record);
    }

    @Override
    @OperationLog(name = "user.selectByPrimaryKey")
    public User selectByPrimaryKey(Long id) {
        int i = 1 / 0;
        return userDao.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(User record) {
        return userDao.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(User record) {
        return userDao.updateByPrimaryKey(record);
    }
}
